/**
 * Created by jaliu on 2015/2/13.
 */


module.exports = function (app) {
    var users = require('../../controllers/backoffice/backOffice-adminUser-controller');
    logger.debug("load the backOffice-frontendUser-route module....");

// opm2.0新增登录
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/admin/login', users.userLogin);


// opm1.0

    //后台用户登录
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/adminUser/login', users.adminUserLogin);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/adminUser/loginByModerator', users.adminUserLoginByModerator);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/adminUser/loginAdminByUserId', users.adminUserLoginServiceByUserId);

    //后台用户增加
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/adminUser', users.adminUserCreate);

    //后台用户修改
    app.put('/rest/' + RESTFullServiceVersion + '/backoffice/adminUser/:loginId', users.adminUserUpdate);

    //后台用户删除
    app.delete('/rest/' + RESTFullServiceVersion + '/backoffice/adminUser/:loginId', users.adminUserDelete);

    //后台用户查询
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/adminUser/findByLoginId/:loginId', users.adminUserFindById);

    //后台用户列表
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/adminUser/getAdminUserList/:startPage/:pageSize', users.adminUserList);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/adminUser/getAdminUserListPaging/:page/:pageSize', users.adminUserListByFilter);

};
